#!/opt/php/bin/php
<?php
require_once 'TVB/ImageInfrastructure/Client/requires.php';

$ii_client = new ImageInfrastructureClient();
$login_id = 'qoo';
$resize_mode = 4;
$format = '2';
$export_arg = '85';
$destination_id = '1';
$callback_url = 'http://ii.api.tvb.com/callback.php';
$watermark = '1';
$source_id = $ii_client->upload($login_id, 'file/test.jpg');
$source_id = $source_id->source_id;
$distribute_list  = array(
        array($login_id, $source_id, 400, 400, $resize_mode, $watermark, $format, $export_arg, $destination_id, $callback_url),
        array($login_id, $source_id, 640, 480, $resize_mode, $watermark, $format, $export_arg, $destination_id, $callback_url),
        array($login_id, $source_id, 641, 481, $resize_mode, $watermark, $format, $export_arg, $destination_id, $callback_url),
        array($login_id, $source_id, 900, 900, $resize_mode, $watermark, $format, $export_arg, $destination_id, $callback_url)
);
$export_ids = $ii_client->requestMultipleDistribute($distribute_list);
print_r($export_ids);

foreach ($export_ids as $export_id) {
	sleep(1);
	$ret = $ii_client->getExportImageUrlEasily($export_id);
	var_dump($ret);
}
?>
